<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>产品资料页面</title>
	<style type="text/css">
		/* 基础样式 */
		.c1 {
			width: 100px;
			height: 100px;
			border: 3px solid #F3970C;
			border-radius: 50%;
			overflow: hidden;
		}

		label {
			position: relative;
		}

		#userimg {
			position: absolute;
			left: 1px;
			top: -103px;
			opacity: 0;
			width: 105px;
			height: 127px;
		}

		#userbtn {
			font-size: 16px;
			padding: 1px 1px;
			background: none;
			color: #0055ff;
			border: none;
			width: 105px;
		}

		progress {
			width: 100px;
			height: 5px;
			border-radius: 3px;
			background-color: #ddd;
		}

		/* 提示框样式 */
		.toast-container {
			position: fixed;
			top: 20px;
			right: 20px;
			z-index: 9999;
		}

		.toast {
			padding: 12px 24px;
			margin-bottom: 10px;
			border-radius: 4px;
			color: white;
			opacity: 0;
			transition: opacity 0.3s ease-in-out;
		}

		.toast.show {
			opacity: 1;
		}

		.toast-success {
			background-color: #4CAF50;
		}

		.toast-error {
			background-color: #f44336;
		}

		.toast-info {
			background-color: #2196F3;
		}

		/* 加载中遮罩 */
		.loading-overlay {
			display: none;
			position: fixed;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
			background-color: rgba(0, 0, 0, 0.5);
			z-index: 9998;
			justify-content: center;
			align-items: center;
		}

		.loading-spinner {
			width: 50px;
			height: 50px;
			border: 5px solid #f3f3f3;
			border-top: 5px solid #3498db;
			border-radius: 50%;
			animation: spin 1s linear infinite;
		}

		@keyframes spin {
			0% { transform: rotate(0deg); }
			100% { transform: rotate(360deg); }
		}
	</style>
</head>

<body>
	<table width="100%" height="100%" border="0" cellpadding="1" cellspacing="0" class="TitleColor">
		<tr>
			<td width="15%" valign="top" bgcolor="#E1E1E1" height="100%">
				<div id='leftpage'>
			</td>

			<td width="85%" valign="top">
				<table width="800" border="0" cellpadding="0" cellspacing="0" align="center">
					<tr height="100">
						<td>&nbsp;</td>
					</tr>
					<tr>
						<td width="102">&nbsp;</td>
						<td width="9">&nbsp;</td>
						<td width="80">用户信息</td>
						<td colspan="2">&nbsp;</td>
						<td width="80">&nbsp;</td>
						<td colspan="2">&nbsp;</td>
					</tr>
					<tr height="10">
						<td>&nbsp;</td>
						<td>&nbsp;</td>
						<td colspan="6">
							<div style="border:1px solid #c3c3c3"></div>
						</td>
					</tr>
					<tr>
						<td rowspan="2" align="center" class="c1"><img src="" width="100" height="100" id="showImg">
						</td>
						<td rowspan="2">&nbsp;</td>
						<td width="80">账号：</td>
						<td width="150" id="kcid"></td>
						<td width="50">&nbsp;</td>
						<td width="80">昵称：</td>
						<td width="150" id="nick"></td>
						<td width="80"><a href="modifyname.htm">修改</a></td>
					</tr>
					<tr>
						<td width="80">手机：</td>
						<td width="150" id="tele"></td>
						<td width="80"><a href="modifytel.htm">修改</a></td>
						<td width="80">邮箱：</td>
						<td width="150" id="emai"></td>
						<td width="80"><a href="modifyemail.htm">修改</a></td>
					</tr>
					<tr>
						<td>
							<label for="userimg">
								<input type="button" id="userbtn" value="修改头像" align="middle">
								<input type="file" id="userimg" onChange="selectImg(this);" accept="image/*"
									title="选择图片">
							</label>
						</td>
						<td>&nbsp;</td>
						<td colspan="6">
							<div style="border:1px solid #c3c3c3"></div>
						</td>
					</tr>
					<tr>
						<td id="bar" style="visibility: hidden;"><progress id="upload-bar" value="0" max="100"></td>
						<td rowspan="4">&nbsp;</td>
						<td width="80">密码：</td>
						<td width="150">******</td>
						<td width="80"><a href="modifypsw.htm">修改</a></td>
						<td width="80">生日：</td>
						<td width="150" id="born"></td>
						<td width="80"><a href="modifybirthday.htm">修改</a></td>
					</tr>
					<tr>
						<td>&nbsp;</td>
						<td width="80">性别：</td>
						<td width="150" id="gend"></td>
						<td width="80"><a href="modifygender.htm">修改</a></td>
						<td width="80">地区：</td>
						<td width="150" id="area"></td>
						<td width="80"><a href="modifyarea.htm">修改</a></td>
					</tr>
					<tr>
						<td>&nbsp;</td>
						<td width="100">歌唱等级：</td>
						<td width="150" id="singlv"></td>
						<td width="80"><a href="viewsingingexperience.htm">查看</a></td>
						<td width="100">VIP等级：</td>
						<td width="150" id="viplv"></td>
						<td width="80"><a href="viewvipexperience.htm">查看</a></td>
					</tr>
					<tr>
						<td>&nbsp;</td>
						<td width="80">财富等级：</td>
						<td width="150" id="wealthlv"></td>
						<td width="80"><a href="viewwealthexperience.htm">查看</a></td>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
					</tr>
					<tr>
						<td colspan="2">&nbsp;</td>
						<td width="100">K币：</td>
						<td width="150" id="money"></td>
						<td>&nbsp;</td>
						<td width="100">人民币：</td>
						<td width="150" id="rmb"></td>
						<td width="80"><a href="recharge.htm">充值</a></td> <!-- 添加人民币充值链接 -->
					</tr>
					<tr>
						<td colspan="2">&nbsp;</td>
						<td width="80">地址：</td>
						<td colspan="4" id="addr"></td>
						<td width="80"><a href="modifyaddress.htm">修改</a></td>
					</tr>
					<tr>
						<td colspan="2">&nbsp;</td>
						<td width="80">介绍：</td>
						<td colspan="4" id="intr"></td>
						<td width="80"><a href="modifyintro.htm">修改</a></td>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
					</tr>
				</table>
			</td>
		<tr>
			<td bgcolor="#E1E1E1" align="center">
				<div id='totalpage'></div>
			</td>
			<td height="60" align="center">
				<div id='footerpage'></div>
			</td>
		</tr>
		</tr>
	</table>

	<!-- 提示框容器 -->
	<div class="toast-container" id="toastContainer"></div>
	
	<!-- 加载中遮罩 -->
	<div class="loading-overlay" id="loadingOverlay">
		<div class="loading-spinner"></div>
	</div>
</body>
<script>
	// 统一的消息提示管理模块
	const Toast = {
		// 创建新的提示框
		create: function(message, type = 'info', duration = 3000) {
			const toast = document.createElement('div');
			toast.className = `toast toast-${type}`;
			toast.textContent = message;
			
			const container = document.getElementById('toastContainer');
			container.appendChild(toast);
			
			// 显示动画
			setTimeout(() => {
				toast.classList.add('show');
			}, 10);
			
			// 自动移除
			setTimeout(() => {
				toast.classList.remove('show');
				setTimeout(() => {
					container.removeChild(toast);
				}, 300);
			}, duration);
		},
		
		// 成功提示
		success: function(message, duration = 3000) {
			this.create(message, 'success', duration);
		},
		
		// 错误提示
		error: function(message, duration = 3000) {
			this.create(message, 'error', duration);
		},
		
		// 信息提示
		info: function(message, duration = 3000) {
			this.create(message, 'info', duration);
		}
	};

	// 加载中遮罩管理
	const Loading = {
		show: function() {
			document.getElementById('loadingOverlay').style.display = 'flex';
		},
		
		hide: function() {
			document.getElementById('loadingOverlay').style.display = 'none';
		}
	};

	function loadScript(c, d) { var b = document.createElement("script"); b.type = "text/javascript"; var e = sessionStorage.getItem(c); e ? (b.textContent = e, d(b)) : fetch(c).then(function (a) { return a.text() }).then(function (a) { b.textContent = a; sessionStorage.setItem(c, a); d(b); location.reload() })["catch"](function (a) { console.error("Error loading the script:", a); Toast.error("加载脚本失败，请刷新页面重试"); }) };
	loadScript("tu_0.js", function (script) { document.head.appendChild(script); });
</script>
<script type="text/javascript" language="javascript">
	if (sessionStorage.getItem("tu_0.js")) {		// 读取记忆是否已保存js文件
		loadHtml("left.htm", "leftpage");
		loadHtml("total.htm", "totalpage");
		loadHtml("footer.htm", "footerpage");
		loadPhoto("img/user_head.jpg", "showImg");
	}

	var first = 0;
	var tick = 0;
	var repeat = 0;
	var rethdst = "";
	function fun() {
		if (first == 0) {
			first = 1;
			setTimeout(function () { myTimer("cookie", 0, 0, 0, 0) }, 0);		//自动发送post指,只有打开页面的时候，才发送一次送一次
		} else {
			if (++tick > 10) {
				tick = 0;
				if (repeat == 1) {
					if (rethdst != null && rethdst != undefined) {
						myTimer("checkFinish", 0, 0, 0, 0);
					}
				}
			}
		}
	}
	setInterval("fun()", 100);			// 周期性调用函数 每隔100毫秒调用一次	

	// 文件上传模块
	const FileUploader = {
		// 初始化上传参数
		init: function(file, kcid) {
			this.file = file;
			this.kcid = kcid;
			this.progressBar = document.getElementById('upload-bar');
			this.barContainer = document.getElementById('bar');
			this.blobSlice = File.prototype.mozSlice || File.prototype.webkitSlice || File.prototype.slice;
			return this;
		},
		
		// 开始上传流程
		start: function() {
			this.showProgress();
			this.calculateMD5(this.file, 0, (md5) => {
				const HEAD = this.createFileHeader(md5);
				myTimer("checkFile", this.file, md5, HEAD, 0);
			});
		},
		
		// 创建文件头信息
		createFileHeader: function(md5) {
			const HEAD = {
				OptTyp: makeType(0, 0, 0x0e), // 用户头像类型
				Kcid: this.kcid,
				FileId: 0x102, // 头像规格
				AuxId1: 0,
				AuxId2: 0,
				FileMD5: md5,
				FileLen: this.file.size,
				Aux: this.file.name,
				MTime: this.file.lastModified,
				BlockMax: 0,
				Hdst: "",
				Assd: ""
			};
			return HEAD;
		},
		
		// 计算文件MD5
		calculateMD5: function(file, index, callback) {
			const fileReader = new FileReader();
			const chunkSize = 2097152; // 每次读取2MB
			const chunks = Math.ceil(file.size / chunkSize);
			let currentChunk = 0;
			const spark = new SparkMD5();
			
			fileReader.onload = (e) => {
				spark.appendBinary(e.target.result);
				currentChunk++;
				if (currentChunk < chunks) {
					loadNext();
				} else {
					callback(spark.end(), index);
				}
			};
			
			const loadNext = () => {
				const start = currentChunk * chunkSize;
				const end = start + chunkSize >= file.size ? file.size : start + chunkSize;
				fileReader.readAsBinaryString(this.blobSlice.call(file, start, end));
			};
			
			loadNext();
		},
		
		// 上传文件块
		uploadChunk: function(file, start, end, bhst) {
			const xhr = new XMLHttpRequest();
			
			xhr.upload.addEventListener('progress', (event) => {
				if (event.lengthComputable) {
					const percentage = Math.round((event.loaded * 100) / event.total);
					this.progressBar.value = percentage;
				}
			}, false);
			
			xhr.onreadystatechange = () => {
				if (xhr.readyState === 4) {
					if (xhr.status === 200) {
						this.progressBar.value = 0;
						this.hideProgress();
					} else {
						this.progressBar.value = 0;
						Toast.error('更换头像失败: ' + xhr.status);
					}
				}
			};
			
			xhr.open('POST', 'upload.php?t:sbui&bhst:' + bhst, true);
			xhr.send(this.blobSlice.call(file, start, end));
			repeat = 1;
		},
		
		// 显示进度条
		showProgress: function() {
			this.barContainer.style.visibility = "visible";
		},
		
		// 隐藏进度条
		hideProgress: function() {
			this.barContainer.style.visibility = "hidden";
		}
	};

	// 选择图片处理函数
	function selectImg() {
		const fileInput = document.getElementById('userimg');
		if (!fileInput.files || !fileInput.files[0]) {
			Toast.error("请选择有效的图片文件");
			return;
		}
		
		const file = fileInput.files[0];
		// 检查文件类型
		if (!file.type.startsWith('image/')) {
			Toast.error("请选择图片文件");
			return;
		}
		
		// 检查文件大小
		if (file.size > 5 * 1024 * 1024) { // 5MB限制
			Toast.error("图片大小不能超过5MB");
			return;
		}
		
		Toast.info("正在处理图片，请稍候...");
		FileUploader.init(file, kcidNum).start();
	}

	var kcidNum = 0;
	function uploadfile(file, start, end, bhst) {
		FileUploader.uploadChunk(file, start, end, bhst);
	}
	function makeType(roomTyp, subTyp, dbsTyp) {
		return ((roomTyp & 0x03) << 10) | ((subTyp & 0x1f) << 5) | (dbsTyp & 0x1f);
	}
	function myTimer(type, file, value, HEAD, BLOCK) {
		var phpName;
		if (type == "checkFile" || type == "checkStep" || type == "checkFinish") {
			phpName = "upload.php";
		} else {
			phpName = "index.php";
		}
		var xhr = postPhp(phpName);
		xhr.onreadystatechange = function () {		//2.注册回调函数
			var array_name = txtUnzip(xhr);
			if (array_name != null) {
				if (type == "cookie") {
					cookiemyFunction(array_name)	// 返回的信息在html页面显
				}
				if (type == "Cread") {
					myFunction(array_name)			// 返回的信息在html页面显
				}
				if (type == "checkFile") {
					checkFileFunction(array_name, file, value, HEAD)	// 返回的信息在html页面显
				}
				if (type == "checkStep") {
					checkStepFunction(array_name, file, value, HEAD, BLOCK)	// 返回的信息在html页面显
				}
				if (type == "waiting") {
					waitFunction(array_name, file, HEAD, BLOCK)		// 返回的信息在html页面显
				}
				if (type == "checkFinish") {
					checkFinishFunction(array_name)	// 返回的信息在html页面显
				}
				if (type == "getimg") {
					getimgFunction(array_name)		// 返回的信息在html页面显
				}
			}
		}

		if (type == "cookie") {
			txtZip(xhr, "t:ncki");
		}
		if (type == "Cread") {
			txtZip(xhr, "t:sbcr");
		}
		if (type == "checkFile") {
			repeat = 0;
			var aux = txtB64Enc(HEAD.Aux);
			txtZip(xhr, "t:upcf&optt:" + HEAD.OptTyp + "&kcid:" + HEAD.Kcid + "&fida:" + HEAD.FileId + "&aux1:" + HEAD.AuxId1 + "&aux2:" + HEAD.AuxId2 +
				"&flen:" + HEAD.FileLen + "&mtim:" + HEAD.MTime + "&md5a:" + HEAD.FileMD5 + "&auxa:" + aux + "&dird:" + 0);
		}
		if (type == "checkStep") {
			var qty = BLOCK.qty;
			var md5s = "";
			for (var index = 0; index < qty; index++) {
				md5s += BLOCK.BlockMD5[index];
			}
			txtZip(xhr, "t:upcs&flen:" + HEAD.FileLen + "&md5a:" + HEAD.FileMD5 + "&bmax:" + HEAD.BlockMax + "&hdst:" + HEAD.Hdst + "&md5s:" + md5s);
		}
		if (type == "waiting") {
			var index = BLOCK.Using;
			var aux = txtB64Enc(HEAD.Aux);
			txtZip(xhr, "t:upwt&optt:" + HEAD.OptTyp + "&kcid:" + HEAD.Kcid + "&fida:" + HEAD.FileId + "&aux1:" + HEAD.AuxId1 + "&aux2:" + HEAD.AuxId2 + "&mtim:" + HEAD.MTime + "&auxa:" + aux
				+ "&md5a:" + HEAD.FileMD5 + "&flen:" + HEAD.FileLen
				+ "&bmd5:" + BLOCK.BlockMD5[index] + "&bsct:" + BLOCK.BlockSector[index] + "&blen:" + BLOCK.BlockLen[index]
				+ "&didx:" + BLOCK.DiskIdx[index] + "&fidx:" + BLOCK.FileIdx[index]);
		}
		if (type == "checkFinish") {
			txtZip(xhr, "t:upch&hdst:" + rethdst);
		}
		if (type == "getimg") {
			txtZip(xhr, "t:sbgi&kcid:" + kcidNum + "&imgt:" + value);
		}


	}

	function strAdd(id, arr, ishide) {
		var value = arr;
		if (ishide) {
			if (id == "tele") {
				var val = parseInt(arr);			// 转int
				if (val != 0 && arr.length > 3) {		// 如果有数据
					value = arr.substr(0, 2);　　	// 截取字符串
					var right = arr.substr(arr.length - 2, 2);	// 前2 后2
					value += '*******' + right;　	// 拼接带*号的隐私号码
				} else {
					value = "未绑定";
				}
			}
			else if (id == "emai") {
				if (arr.length > 3) {					// 如果有数据
					var bef = arr.split('@');
					var length = bef[0].length;
					var left = parseInt(length / 4);
					var mid = length - left * 2;
					value = arr.substr(0, left);　　// 截取字符串
					var right = arr.substr((left + mid), arr.length - (left + mid));
					for (var i = 0; i < mid; i++) {
						value += "*";
					}
					if (arr) {				// 如果有数据
						value += right;　	// 拼接带*号的隐私号码
					} else {
						value = "未绑定";
					}
				}
			}
		}
		document.getElementById(id).textContent = value;
	}
	function cookiemyFunction(arr) {
		switch (arr.result) {
			case "ok":
				myTimer("Cread", 0, 0, 0, 0);
				document.getElementById("totalSpace").textContent = showSpace(arr.totd, arr.usdd);
				break;
			default:
				alert('请先登录后，再操作！');
				window.location.href = "user.htm";
				return false;
		}
	}

	function myFunction(arr) {
		kcidNum = arr.kcid;
		strAdd("kcid", arr.kcid, false);
		strAdd("nick", decodeURI(arr.nick), false);
		strAdd("tele", decodeURI(arr.tele), true);
		strAdd("emai", decodeURI(arr.emai), true);
		strAdd("intr", decodeURI(arr.intr), false);
		strAdd("born", decodeURI(arr.born), false);
		var relation = makeUserRelation(arr.urel);
		strAdd("gend", relation.Gender == 0 ? "女" : (relation.Gender == 1 ? "男" : "保密"), false);
		// 提取地区信息
		var area = decodeURI(arr.area);
		strAdd("area", area, false);
		// 将地区信息保存到本地存储
		sessionStorage.setItem("area", area);
		strAdd("singlv", relation.SingerLv, false);
		strAdd("viplv", relation.VipLv, false);
		strAdd("wealthlv", relation.WealthLv, false);
		var money = (BigInt(parseInt(arr.kmoh)) << 32n) + BigInt(parseInt(arr.kmol));
		var rmb = (BigInt(parseInt(arr.rmbh)) << 32n) + BigInt(parseInt(arr.rmbl));
		strAdd("money", money.toString(), false); // 新增 K币 显示
		strAdd("rmb", rmb.toString(), false); // 新增 人民币 显示
		var address = decodeURI(arr.addr);
		strAdd("addr", address, false);
		sessionStorage.setItem("address", address);

		document.getElementById("showImg").src = "uimg/" + arr.uimg; 	// 显示头像图片文件
		sessionStorage.setItem("nick", decodeURI(arr.nick));
		sessionStorage.setItem("info", decodeURI(arr.intr));
	}

	function checkFileFunction(arr, file, value, HEAD) {
		switch (arr.result) {
			case "ok":
				HEAD.BlockMax = arr.bmax;
				HEAD.FileId = arr.fida;
				HEAD.Hdst = arr.hdst;
				rethdst = arr.hdst;
				// 创建文件块对象
				const BLOCK = {
					qty: Math.ceil(file.size / HEAD.BlockMax),
					FileMD5: HEAD.FileMD5,
					FileLen: HEAD.FileLen,
					Using: 0,
					BlockMD5: [],
					BlockSector: [],
					BlockLen: [],
					FileIdx: [],
					DiskIdx: [],
					ErrNum: [],
					Bhst: []
				};
				// 处理文件块
				const blobSlice = File.prototype.mozSlice || File.prototype.webkitSlice || File.prototype.slice;
				let times = 0;
				for (let index = 0; index < BLOCK.qty; index++) {
					const left = (file.size - index * HEAD.BlockMax);
					BLOCK.BlockLen[index] = left >= HEAD.BlockMax ? HEAD.BlockMax : left;
					BLOCK.ErrNum[index] = 0;
					BLOCK.Bhst[index] = "";
					const offset = index * HEAD.BlockMax;
					const end = offset + BLOCK.BlockLen[index];
					const blob = blobSlice.call(file, offset, end);
					FileUploader.calculateMD5(blob, index, function (md5, idx) {
						BLOCK.BlockMD5[idx] = md5;
						if (++times >= BLOCK.qty) {
							myTimer("checkStep", file, value, HEAD, BLOCK);
						}
					});
				}
				break;
			case "file":
				Toast.error("上传失败");
				FileUploader.hideProgress();
				return false;
			case "file exist":
				repeat = 0;
				Toast.info("文件已存在，无需重新上传");
				FileUploader.hideProgress();
				myTimer("getimg", 0, 257, 0, 0);
				return false;
			default:
				Toast.error("上传检查失败: " + arr.result);
				FileUploader.hideProgress();
				return false;
		}
	}

	function checkStepFunction(arr, file, value, HEAD, BLOCK) {
		switch (arr.result) {
			case "ok":
				const list = JSON.parse(arr.assd);
				for (let index = 0; index < BLOCK.qty; index++) {
					BLOCK.DiskIdx[index] = 0;
					BLOCK.BlockSector[index] = 0;
					for (let idx2 = 0; idx2 < list.length; idx2++) {
						if (list[idx2][0] == index) {
							BLOCK.FileIdx[index] = index;
							BLOCK.DiskIdx[index] = list[idx2][1];
							BLOCK.BlockSector[index] = list[idx2][2];
							BLOCK.ErrNum[index] = list[idx2][3];
						}
					}
					if (BLOCK.ErrNum[index] != 6 && BLOCK.ErrNum[index] != 0) {
						BLOCK.Using = index;
						myTimer("waiting", file, BLOCK.BlockMD5[index], HEAD, BLOCK);
					}
				}
				break;
			case "file":
				Toast.error("上传准备失败");
				FileUploader.hideProgress();
				return false;
			case "file exist":
				repeat = 0;
				FileUploader.hideProgress();
				myTimer("getimg", 0, 257, 0, 0);
				return false;
			default:
				Toast.error("上传准备失败: " + arr.result);
				FileUploader.hideProgress();
				return false;
		}
	}
	function waitFunction(arr, file, HEAD, BLOCK) {
		switch (arr.result) {
			case "ok":
				BLOCK.Bhst = arr.bhst;
				const start = arr.fidx * HEAD.BlockMax + arr.offs;
				const end = start + BLOCK.BlockLen[arr.fidx];
				uploadfile(file, start, end, arr.bhst);
				break;
			case "file":
				Toast.error("上传等待失败");
				FileUploader.hideProgress();
				return false;
			default:
				Toast.error("上传等待失败: " + arr.result);
				FileUploader.hideProgress();
				return false;
		}
	}
	
	// 检查文件块是否全部完成
	function isArrayComplete(array) {
		const totalCount = array.length;
		let completedCount = 0;
		
		for (let i = 0; i < array.length; i++) {
			if (array[i].length > 0 && array[i][array[i].length - 1] === 6) {
				completedCount++;
			}
		}
		
		return (completedCount / totalCount) * 100;
	}
	
	function checkFinishFunction(arr) {
		switch (arr.result) {
			case "ok":
				const list = JSON.parse(arr.assd);
				const percent = isArrayComplete(list, 0);
				if (percent == 100) {
					repeat = 0;
					rethdst = null;
					FileUploader.hideProgress();
					Toast.success("头像上传成功");
					myTimer("getimg", 0, 257, 0, 0);
				} else {
					const progressBar = document.getElementById('upload-bar');
					progressBar.value = percent;
					document.getElementById("bar").style.visibility = "visible";
				}
				break;
			case "file exist":
				repeat = 0;
				rethdst = null;
				Toast.success("头像上传成功");
				myTimer("getimg", 0, 257, 0, 0);
				return true;
			case "file":
				Toast.error("头像上传失败");
				FileUploader.hideProgress();
				return false;
			case "file in temp":
			case "file unexist":
				// 保持原逻辑：不做特殊处理
				break;
			default:
				Toast.error("上传完成检查失败: " + arr.result);
				FileUploader.hideProgress();
				return false;
		}
	}

	function getimgFunction(arr) {
		switch (arr.result) {
			case "ok":
				const img = document.getElementById("showImg");
				let picImg = "uimg/" + arr.uimg;
				const randomParam = Math.random();
				picImg += "?v=" + randomParam;
				img.onload = function () {
					console.log("图片加载成功");
				};
				img.onerror = function () {
					Toast.error("头像加载失败，请刷新页面重试");
				};
				img.src = picImg;
				break;
			default:
				Toast.error("获取头像失败: " + arr.result);
				return false;
		}
	}
</script>

</html>